package com.example.source_share.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Files {
    @TableId(type = IdType.AUTO)
    private Integer fileid;
    private String filename;
    private String size;
    private String majorid;
    private String subject;
    private String author;
    private Timestamp updatedate;
    private String description;
    private String filepath;
    private String kind;
    private String grade;
    private String year;
    private Integer download;
    public Files(String filename, String size,String author,String filepath) {
        fileid=0;
        this.filename=filename;
        this.size=size;
        majorid="1";
        subject="";
        this.author=author;
        //当前日期
        Date date = new Date();
        updatedate= new Timestamp(date.getTime());
        description="";
        this.filepath=filepath;
        kind="";
        download=0;
    }

    public Files(String originalFilename, String size, String major, String subject, String author, String description, String kind, String path,String grade,String year) {
        this.filename=originalFilename;
        this.size=size;
        this.majorid=major;
        this.subject=subject;
        this.author=author;
        this.description=description;
        this.kind=kind;
        this.filepath=path;
        Date date = new Date();
        updatedate= new Timestamp(date.getTime());
        this.grade=grade;
        this.year=year;
        download=0;
    }
}
